package com.chb.flyweight;

/**
 * @author chihb
 * @create-time 2024/10/24 15:02
 * @description
 */
public class Test {
    public static void main(String[] args) {
        PieceFactory pieceFactory = new PieceFactory();
        Piece wpiece = pieceFactory.getPiece(1);
        Piece wpiece2 = pieceFactory.getPiece(1);
        Piece wpiece3 = pieceFactory.getPiece(1);
        System.out.println(wpiece);
        System.out.println(wpiece3);
        System.out.println(wpiece==wpiece2);
        wpiece.draw(1,2);
        Piece bpiece = pieceFactory.getPiece(0);
        bpiece.draw(3,4);
    }
}
